

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.*;

/**
 * Method that paints an image on a Jpanel 
 * @param the filename, width of panel, size of panel
 * @return void
 */
public class ImagePanel extends JPanel{
	
	private Image image = null;
	private int width;
	private int height;

    public ImagePanel(String filename , int width, int height) {
    	this.image = new ImageIcon(filename).getImage();
    	this.width = width;
    	this.height = height;
        }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(image, 0, 0, width, height , null);
     }
    
}
